import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    mode:'hash',
    routes: [
        {
            path: '/',
            // redirect: '/login'
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '@/components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '@/components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/icon',
                    component: () => import(/* webpackChunkName: "icon" */ '@/components/page/Icon.vue'),
                    meta: { title: '自定义图标' }
                },
                {
                    path: '/company-list',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/company-list.vue'),
                    meta: { title: '公司管理' }
                },
                {
                    path: '/company-detail',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/company-detail.vue'),
                    meta: { title: '公司详情' }
                },
                {
                    path: '/product-list',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/product-list.vue'),
                    meta: { title: '产品列表' }
                },
                {
                    path: '/advertisement-detail',
                    component: () => import(/* webpackChunkName: "table" */ '@/components/page/advertisement-detail.vue'),
                    meta: { title: '广告详情' },
                },
                {
                    path: '/advertisement-list',
                    component: () => import(/* webpackChunkName: "table" */ '@/components/page/advertisement-list.vue'),
                    meta: { title: '广告列表' },
                },
                {
                    path: '/table',
                    component: () => import(/* webpackChunkName: "table" */ '@/components/page/BaseTable.vue'),
                    meta: { title: '软文列表' },
                },
                {
                    path:'/BaseTableAdd',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/BaseTableAdd.vue'),
                    meta: { title: '新增软文' }
                },
                {
                    path: '/author-list',
                    component: () => import(/* webpackChunkName: "table" */ '@/components/page/author-list.vue'),
                    meta: { title: '作者列表' },
                },

                {
                    path: '/column-list',
                    component: () => import(/* webpackChunkName: "table" */ '@/components/page/column-list.vue'),
                    meta: { title: '栏目管理' },
                },

                {
                    path: '/exhibition-management',
                    component: () => import(/* webpackChunkName: "table" */ '@/components/page/exhibition-management.vue'),
                    meta: { title: '主题展管理' },
                },
                {
                    path: '/exhibitionCompanyList',
                    component: () => import(/* webpackChunkName: "form" */ '@/components/page/exhibitionCompanyList.vue'),
                    meta: { title: '主题展公司' }
                },
                {
                    path: '/exhibition-detail',
                    component: () => import(/* webpackChunkName: "form" */ '@/components/page/exhibition-detail.vue'),
                    meta: { title: '主题内容' }
                },
                {
                    path: '/exhibition-add',
                    component: () => import(/* webpackChunkName: "form" */ '@/components/page/exhibition-add.vue'),
                    meta: { title: '新增主题' }
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '@/components/page/Tabs.vue'),
                    meta: { title: 'tab选项卡' }
                },
                {
                    path: '/form',
                    component: () => import(/* webpackChunkName: "form" */ '@/components/page/BaseForm.vue'),
                    meta: { title: '基本表单' }
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: () => import(/* webpackChunkName: "editor" */ '@/components/page/VueEditor.vue'),
                    meta: { title: '富文本编辑器' }
                },
                // {
                //     // 富文本编辑器组件
                //     path: '/wangEditor',
                //     component: () => import(/* webpackChunkName: "editor" */ '@/components/page/wangEditor.vue'),
                //     meta: { title: '富文本编辑器' }
                // },
                {
                    // markdown组件
                    path: '/markdown',
                    component: () => import(/* webpackChunkName: "markdown" */ '@/components/page/Markdown.vue'),
                    meta: { title: 'markdown编辑器' }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: () => import(/* webpackChunkName: "upload" */ '@/components/page/Upload.vue'),
                    meta: { title: '文件上传' }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '@/components/page/BaseCharts.vue'),
                    meta: { title: 'schart图表' }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () => import(/* webpackChunkName: "drag" */ '@/components/page/DragList.vue'),
                    meta: { title: '拖拽列表' }
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '@/components/page/DragDialog.vue'),
                    meta: { title: '拖拽弹框' }
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () => import(/* webpackChunkName: "i18n" */ '@/components/page/I18n.vue'),
                    meta: { title: '国际化' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '@/components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },

                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '@/components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '@/components/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/donate',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/Donate.vue'),
                    meta: { title: '支持作者' }
                }
                ,
                {
                    path: '/content-detail',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/content-detail.vue'),
                    meta: { title: '新增软文' }
                },
                {
                    path: '/product-detail',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/product-detail.vue'),
                    meta: { title: '新增产品' }
                },
                {
                    path:'/city-admin',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/city-admin.vue'),
                    meta: { title: '城市管理' }
                },
                {
                    path:'/city-town-admin',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/city-town-admin.vue'),
                    meta: { title: '地区管理' }
                },
                {
                    path:'/city-base-admin',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/city-base-admin.vue'),
                    meta: { title: '地区软文管理' }
                },{
                    path:'/project-list',
                    component: () => import(/* webpackChunkName: "donate" */ '@/components/page/project-list.vue'),
                    meta: { title: '地区软文管理' }
                },
                // {
                //     // 测试页面
                //     path: '/ceshi',
                //     component: () => import(/* webpackChunkName: "editor" */ '@/components/page/ceshi.vue'),
                //     meta: { title: '测试页面' }
                // }
                
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '@/components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
